package com.mtons.mblog.modules.repository;

import com.mtons.mblog.modules.entity.RolePermission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 数据层
 * @author - langhsu
 * @create - 2018/5/18
 */
public interface RolePermissionRepository extends JpaRepository<RolePermission, Long>, JpaSpecificationExecutor<RolePermission> {

    /**
     * 删除
     * @param roleId
     * @return
     */
    int deleteByRoleId(long roleId);

    /**
     * 查找角色权限
     * @param roleId
     * @return
     */
    List<RolePermission> findAllByRoleId(long roleId);
}
